--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit f0e9fa66598b31e3ae4bcc9f188bb63bc298ba5e
Parents : 7a1bcc1
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-01-16T13:26:33+01:00
Corrected inconsistent property, getter and setter use. Fixed #16.
Changes
Diff
diff --git a/LXMF/LXMessage.py b/LXMF/LXMessage.py
index 0fe1ccf..3cf8122 100644
--- a/LXMF/LXMessage.py
+++ b/LXMF/LXMessage.py
@@ -170,6 +170,17 @@ class LXMessage:
def get_fields(self):
return self.fields
+ @property
+ def destination(self):
+ return self.__destination
+
+ @destination.setter
+ def destination(self, destination):
+ self.set_destination(destination)
+
+ def get_destination(self):
+ return self.destination
+
def set_destination(self, destination):
if self.destination == None:
if isinstance(destination, RNS.Destination):
@@ -179,8 +190,16 @@ class LXMessage:
else:
raise ValueError("Cannot reassign destination on LXMessage")
- def get_destination(self):
- return self.__destination
+ @property
+ def source(self):
+ return self.__source
+
+ @source.setter
+ def source(self, source):
+ self.set_source(source)
+
+ def get_source(self):
+ return self.source
def set_source(self, source):
if self.source == None:
@@ -191,9 +210,6 @@ class LXMessage:
else:
raise ValueError("Cannot reassign source on LXMessage")
- def get_source(self):
- return self.__source
-
def set_delivery_destination(self, delivery_destination):
self.__delivery_destination = delivery_destination
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────